<?php

declare(strict_types=1);

namespace App\CustHub\Interfaces;

use EasyWeChat\OpenWork\Application;
use EasyWeChat\OpenWork\SuiteAccessToken;

interface OpenWorkApplicationInterface
{
    public function getOpenWork(): Application;
    public function getTxlWork():Application;

    public function getApp(mixed $agentId): Application;

    /**
     * 获取授权二维码
     * @param int $authType
     * @return mixed
     */
    public function getAuthQrCode(int $authType,int $mainUid): mixed;

    public function getSuiteAccessToken(string $suiteId, string $suiteSecret): SuiteAccessToken;

    public function getTxlSuiteAccessToken(string $suiteId, string $suiteSecret): SuiteAccessToken;

    public function getPermanentCode(string $suiteAccessToken, string $authCode): array;

    public function getAgentInfo(string $accessToken, int $agentId): array;

    public function getCustomizedAuthUrl(string $providerAccessToken,string $state, array $templateidList):string;

    public function getAccessToken(string $corpid, string $corpsecret): string;

    public function corpidToOpencorpid(string $wx_corpid);

    /**
     * 创建接口许可证订单
     * @param string $corpid
     * @param string $userId
     * @param int $externalContactCount
     * @param int $months
     * @return string|bool
     */
    public function createNewOrder(string $corpid,string $userId,int $externalContactCount,int $months):  string|bool;

    /**
     * 续费
     * @param string $corpid
     * @param array $accountList
     * @param string $jobid
     * @return array
     */
    public function createRenewOrderJob(string $corpid,array $accountList,string $jobid = ''):  array;


    /**
     * 获取订单信息
     * @param string $orderId
     * @return array
     */
    public function getOrder(string $orderId):array;


    /**
     * 提交续期订单
     * @param string $jobid
     * @param string $buyer_userid
     * @param array $account_duration
     * @return mixed
     */
    public function submitOrderJob(string $jobid,string $buyer_userid,array $account_duration): mixed;

    /**
     * 余额支付
     * @param string $payer_userid
     * @param string $order_id
     * @return mixed
     */
    public function submitPayJob(string $payer_userid,string $order_id): mixed;

    /**
     * 获取订单对应的账号列表
     * @param string $orderId
     * @param string $cursor
     * @param int $limit
     * @return array
     */
    public function getListOrderAccount(string $orderId,string $cursor = '',int $limit = 1000):array;

    /**
     * 激活账号
     * @param string $activeCode
     * @param string $corpid
     * @param string $userid
     * @return bool
     */
    public function activeAccount(string $activeCode,string $corpid,string $userid):bool;

    /**
     * 账号继承
     * @param string $corpid
     * @param string $handoverUserid
     * @param string $takeoverUserid
     * @return bool
     */
    public function transferLicense(string $corpid,string $handoverUserid,string $takeoverUserid):bool;

    public function getActiveInfoByUser(string $corpId,string $userid);

    /**
     * 创建收款订单订单
     * @param array $data
     * @return array
     */
    public function paytoolOpenOrder(array $data): array;

    /**
     * 获取收款订单列表
     * @param array $data
     * @return array
     */
    public function paytoolGetOrderList(array $data): array;
}